<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>易商通运营平台</title>
 	<script type="text/javascript"src="__PUBLIC__/libs/js/jquery.js"></script>
	<script type="text/javascript"src="__PUBLIC__/libs/js/framework.js"></script>
	<link href="__PUBLIC__/libs/css/import_basic.css"rel="stylesheet"type="text/css"/>
	<link rel="stylesheet"type="text/css"id="skin"prePath="__PUBLIC__/"/>
	<link rel="stylesheet"type="text/css"id="customSkin"/>
	<script type="text/javascript"src="__PUBLIC__/libs/js/form/datePicker/WdatePicker.js"></script>
	<script type="text/javascript"src="__PUBLIC__/libs/js/nav/pageNumber.js"></script>
	<style>body{background-color:#dbeefd}</style>
</head>
    <body>
        <div class="wrap">
          
            <div class="mainBody"> 
                    <div class="Item hr">
                        <div class="current">角色管理</div>
                    </div>
                    <table   class="tableStyle">
                        <thead>
                            <tr>
                                <td>序号</td>
                                <td>组ID</td>
                                <td>组名</td>
                                <td>描述</td>
                                <td>状态</td>
                                <td>操作</td>
                            </tr>
                        </thead>
                        <volist name="list" id="vo" key="k">
                            <tr align="center" id="{$vo.id}">
                                <td>{$k}</td>
                                <td>{$vo.id}</td>
                                <td>{$vo.name}</td>
                                <td align="left">{$vo.remark}</td>
                                <td>{$vo.statusTxt}</td>
                                <td><if condition="$vo.pid eq 0">--<else/>[ <a href="javascript:void(0);" class="opStatus" val="{$vo.status}">{$vo.chStatusTxt}</a> ] [ <a href="__URL__/editRole?id={$vo.id}" class="edit">编辑</a> ] [ <a href="__URL__/changeRole?id={$vo.id}" class="edit">权限分配</a> ]</if></td>
                            </tr>
                        </volist>
                    </table>
                </div>
            </div>
      
        <div class="clear"></div>
        <include file="Common:foot" />
        <script type="text/javascript">
            $(function(){
                //快捷启用禁用操作
                $(".opStatus").click(function(){
                    var obj=$(this);
                    var id=$(this).parents("tr").attr("id");
                    var status=$(this).attr("val");
                    $.getJSON("__URL__/opRoleStatus", { id:id, status:status }, function(json){
                        if(json.status==1){
                            popup.success(json.info);
                            $(obj).attr("val",json.data.status).html(status==1?"启用":"禁用").parents("td").prev().html(status==1?"禁用":"启用");
                        }else{
                            popup.alert(json.info);
                        }
                    });
                });
            });
        </script>
    </body>
</html>
